Variable-order Bayesian network